#include<stdio.h>
#include<stdlib.h>
int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize)
{
	int min=1;
	int max=numsSize;
	int *ret=(int*)malloc(numsSize*sizeof(int));
	int k=0;
	for(int i=min;i<=max;i++)
	{
		int flag=0;
		for(int j=0;j<numsSize;j++)
		{
			if(i==nums[j])
			{
				flag=1;
				break;
			}
		}
		if(flag==0)
		{
			ret[k]=i;
			k++; 
		}
	}
	(*returnSize)=k;
	return ret;
}

int main()
{
	int nums[] = {4,3,2,7,8,2,3,1};
	int returnSize=0;
	int* p=findDisappearedNumbers(nums,8,&returnSize);
	for(int i=0;i<returnSize;i++)
	{
		printf("%d ",p[i]);
	}
	free(p);
	return 0;
}
